home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / H-I / HyperHackers.cpt / Hyper-Hackers Queue 1.0 / card_8933.txt < prev    next >
Text File  |  1989-02-26  |  2KB  |  59 lines

  1. -- card: 8933 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3797
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 1
  9. ----- text -----
  10.  
  11. Date:       Thu, 19 Nov 87 11:11:06 PST
  12. From: PUGH@NMFECC.ARPA
  13.  
  14.  
  15. Here is a script to install in your Home stack if you get tired of
  16. changing data in locked fields.  Instead of the choose field tool,
  17. double click field, turn lock text off, click OK, choose browse tool,
  18. change text, choose field tool, double click field, turn lock text on,
  19. click OK, and choose browse tool, (which can get a mite tiresome), just
  20. use Option-Click on a field (without a script in it) to unlock it, and
  21. Command-Click to turn it back on.
  22.  
  23. This passes a mouseUp through the unlocked field because you have the
  24. Commandkey down, which puts the text into the msg box and displays it.
  25. The script hides the msg box, so it flashes on the screen momentarily.
  26. This does not interfere with the normal operation of the Commandkey on
  27. locked text items.
  28.  
  29. Hypercard could use andThen and orElse operators for it's boolean evaluations.
  30. That or if the if statement evaluation was shortcutted by default.
  31.  
  32. This script uses a command-click on an unlocked field to lock it and an 
  33. option-click on a locked field to unlock it.
  34.  
  35. on mouseUp
  36.   if the optionKey is down then
  37.     get the name of the target
  38.     if it contains "field" then
  39.       if lockText of it then set the lockText of it to false
  40.     end if
  41.   else if the commandKey is down then
  42.     get the name of the target
  43.     if it contains "field" then
  44.       if lockText of it is false then
  45.         hide msg
  46.         set the lockText of it to true
  47.       end if
  48.     end if
  49.   else
  50.     pass mouseUp
  51.     exit mouseUp
  52.   end if
  53. end mouseUp
  54.  
  55.  
  56.  
  57. -- part contents for background part 45
  58. ----- text -----
  59. Locking and unlocking fields made easy